<template>
    <!-- <div class="modal-overlay" v-if="visible" @click="close" ref="dialog"> -->
    <div :class="{ 'modal-overlay': visible, 'modal-overlay1': !visible }" @click="close" ref="dialog">
        <div class="myBox">

            <slot> </slot>
        </div>
    </div>
</template>

<script>
import { httpService } from "@/utils/httpService";
import { formatTime1 } from "@/utils/dateFormat";

export default {
    props: {
        visible: {
            type: Boolean,
            default: false
        },
        position: {
            type: Boolean,
            default: false
        },
    },
    data() {
        return {
            // visible: false,
            visiFlag: false,
        };
    },
    components: {

    },
    watch: {

    },
    mounted() {
        // console.log(window.innerWidth, this.$refs.dialog.offsetHeight);
    },
    methods: {
        close() {
            this.$emit("close");
        },

    }
}
</script>

<style scoped>
* {
    margin: 0;
    padding: 0;
}

.flex {
    display: flex;
    align-items: center;
}

.myDialog {
    width: 100vw;
    min-height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: auto !important;
}


.box {
    display: flex;
    justify-content: center;
    overflow: auto !important;
}

.dialogBox {
    height: 2000px;
    width: 500px;
    background-color: brown;
    overflow: auto !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 999;
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    overflow-y: auto;
    transition: all 0.3s ease-in;
}

.modal-overlay1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -11;
    opacity: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    overflow-y: auto;
    transition: all 0.3s ease-in;
}

.modal-overlay::-webkit-scrollbar {
    width: 0 !important;
}

.modal-overlay1::-webkit-scrollbar {
    width: 0 !important;
}
</style>